﻿<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" id="viewport"
          content="width=device-width, minimum-scale=1, maximum-scale=1, initial-scale=1.0,user-scalable=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
    <meta name="format-detection" content="telephone=yes"/>
    <meta name="msapplication-tap-highlight" content="no"/>
    <meta charset="utf-8">
    <link href="../../css/css.css" rel="stylesheet" type="text/css"/>
</head>

<body>
<form action="commentinput.html" accept-charset="gbk" target="_self">
    <div class="comment-box">
        <div class="comment-input">
            <input type="text" id="commentcontent" placeholder="发表下您的点评"/>
        </div>
        <a class="comment-button" href="javascript:submintComment()">发送</a>
    </div>
</form>
</body>
<script src="../../js/common/jquery-2.1.4.min.js" type="text/javascript"></script>
<script src="../../js/config.js" type="text/javascript"></script>
<script src="../../js/common/common.js" type="text/javascript"></script> 
<script type="text/javascript">
    document.onkeydown = function (e) {
        e = e || event;
        if (e.keyCode == 13) {  //判断是否单击的enter按键(回车键)
            submintComment();
        }
        document.getElementById("commentcontent").style.borderColor = "#CCCCCC";
    }

    function submintComment() {
        var content = document.getElementById("commentcontent").value;
        if(!content){
          document.getElementById("commentcontent").style.borderColor = "red";
        }
        document.getElementById("commentcontent").value = null;
        document.getElementById("commentcontent").blur();
        parent.commitComment(content);
    }
</script>

</html>
